package com.ruoyi.common.enums;

public enum ButtonEums {

    // 让步使用
    RBSY_BUTTON(1,"让步使用"),
    // 合格
    OK_BUTTON(2,"合格"),
    // 挑选使用
    TXSY_BUTTON(3,"挑选使用"),
    // 降级处理
    JJCL_BUTTON(4,"降级处理"),
    // 通过
    TG_BUTTON(5,"通过"),
    // 驳回
    BH_BUTTON(6,"驳回"),
    // 不通过
    BTG_BUTTON(7,"不通过"),
    // 退货
    TH_BUTTON(8,"退货"),
    // 申请降级
    SQJJ_BUTTON(9,"申请降级"),
    // 拒收
    JS_BUTTON(10,"拒收"),
    // 同意降级
    TYJJ_BUTTON(11,"同意降级"),

    FJSQ_BUTTON(12,"复检申请"),

    QESP_BUTTON(13,"确认审批"),
    ;

    private final int value;

    private final String description;

    ButtonEums(int value,String description) {
        this.value = value;
        this.description = description;
    }


    /**
     * 获取值
     * @return
     */
    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据值获取枚举项
     * @param value
     * @return
     */
    public static ButtonEums fromValue(int value) {
        for (ButtonEums ButtonEums : ButtonEums.values()) {
            if (ButtonEums.getValue() == value) {
                return ButtonEums;
            }
        }
        throw new IllegalArgumentException("Unexpected value: " + value);
    }

    /**
     * 根据值获取描述
     * @param value
     * @return
     */
    public static String getDescriptionByValue(int value) {
        ButtonEums buttonEnum = fromValue(value);
        return buttonEnum.getDescription();
    }
}
